#include "yswidget.h"

#include <mainwindow.h>

YSWidget::YSWidget(QWidget *parent)
    : QWidget{parent}
{}

void YSWidget::showEvent(QShowEvent *event)
{
    Q_UNUSED(event)
    if(m_bFirst)
    {
        m_bFirst=false;
        // 计算新的按钮大小
        int newWidth = static_cast<int>(width() * g_xScale);
        int newHeight = static_cast<int>(height() * g_xScale);
        setFixedSize(newWidth, newHeight);
    }
}
